#include <iostream>
#include <cmath>

using namespace std;

long Fibonacci(int n) {
	if (n == 0 || n == 1)
		return n;

	return Fibonacci(n-1) + Fibonacci(n-2);
}

long Fast_Fibonacci(int n) {
	if (n == 0 || n == 1)
		return n;
	double sqrt5 = sqrt(5);
	return long(sqrt5/5*pow((1+sqrt5)/2, n)-sqrt5/5*pow((1-sqrt5)/2, n));
}

int main()
{
	int n;
	while(cin >> n) {
		cout << Fast_Fibonacci(n) << endl;
	}
	
	return 0;
}
